<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
            <li>
			用户id：<input type="text" name="userId"/>
        </li>
	            <li>
			昵称：<input type="text" name="nickName"/>
        </li>
	            <li>
			头像：<input type="text" name="headImg"/>
        </li>
	            <li>
			用户名：<input type="text" name="userName"/>
        </li>
	            <li>
			手机号码：<input type="text" name="mobilePhone"/>
        </li>
	            <li>
			邮箱：<input type="text" name="email"/>
        </li>
	            <li>
			密码：<input type="text" name="password"/>
        </li>
	            <li>
			实名认证(0否，1是)：<input type="text" name="certified"/>
        </li>
	            <li>
			姓名：<input type="text" name="realName"/>
        </li>
	            <li>
			证件号码：<input type="text" name="idCardNo"/>
        </li>
	            <li>
			交易密码：<input type="text" name="tradePassword"/>
        </li>
	            <li>
			cnn余额：<input type="text" name="cnnAmount"/>
        </li>
	            <li>
			cnn可提现余额：<input type="text" name="cnnWithdrawAmount"/>
        </li>
	            <li>
			vc余额：<input type="text" name="vcAmount"/>
        </li>
	            <li>
			vc消费资产：<input type="text" name="vcConsumeAmount"/>
        </li>
	            <li>
			vc理财资产：<input type="text" name="vcWithdrawAmount"/>
        </li>
	            <li>
			邀请码：<input type="text" name="referrerCode"/>
        </li>
	            <li>
			推荐人id：<input type="text" name="referrerId"/>
        </li>
	            <li>
			领导人id：<input type="text" name="leaderId"/>
        </li>
		<li>
			等级：<select name="level" th:with="type=${@dict.getType('user_level')}">
			<option value="">所有</option>
			<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
		</select>
		</li>
	            <li>
			版本号：<input type="text" name="version"/>
        </li>
	            <li>
			删除标志（0代表存在 1代表删除）：<input type="text" name="delFlag"/>
        </li>
	            <li>
			创建者：<input type="text" name="createBy"/>
        </li>
	    		<li class="select-time">
			<label>创建时间： </label>
			<input type="text" class="date-input" id="startCreateTime" placeholder="开始" name="params[beginCreateTime]"/>
			<span>-</span>
			<input type="text" class="date-input" id="endCreateTime" placeholder="结束" name="params[endCreateTime]"/>
		</li>
	            <li>
			更新者：<input type="text" name="updateBy"/>
        </li>
	    		<li class="select-time">
			<label>更新时间： </label>
			<input type="text" class="date-input" id="startUpdateTime" placeholder="开始" name="params[beginUpdateTime]"/>
			<span>-</span>
			<input type="text" class="date-input" id="endUpdateTime" placeholder="结束" name="params[endUpdateTime]"/>
		</li>
	            <li>
			备注信息：<input type="text" name="remark"/>
        </li>
								<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="system:wdyUser:add">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.editFull()" shiro:hasPermission="system:wdyUser:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:wdyUser:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:wdyUser:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:wdyUser:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:wdyUser:remove')}]];
        var prefix = ctx + "system/wdyUser";
        var userLevel = [[${@dict.getType('user_level')}]];
        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "用户",
		        showExport: false,
                sortName: "createTime",
                sortOrder: "desc",
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : 'id',
					visible: false
				},
				{
					field : 'userId', 
					title : '用户id',
					sortable: true
				},
				{
					field : 'nickName', 
					title : '昵称',
					sortable: true
				},
				{
					field : 'headImg', 
					title : '头像',
					sortable: true
				},
				{
					field : 'userName', 
					title : '用户名',
					sortable: true
				},
				{
					field : 'mobilePhone', 
					title : '手机号码',
					sortable: true
				},
				{
					field : 'email', 
					title : '邮箱',
					sortable: true
				},
				{
					field : 'password', 
					title : '密码',
					sortable: true
				},
				{
					field : 'certified', 
					title : '实名认证(0否，1是)',
					sortable: true
				},
				{
					field : 'realName', 
					title : '姓名',
					sortable: true
				},
				{
					field : 'idCardNo', 
					title : '证件号码',
					sortable: true
				},
				{
					field : 'tradePassword', 
					title : '交易密码',
					sortable: true
				},
				{
					field : 'cnnAmount', 
					title : 'cnn余额',
					sortable: true
				},
				{
					field : 'cnnWithdrawAmount', 
					title : 'cnn可提现余额',
					sortable: true
				},
				{
					field : 'vcAmount', 
					title : 'vc余额',
					sortable: true
				},
				{
					field : 'vcConsumeAmount', 
					title : 'vc消费资产',
					sortable: true
				},
				{
					field : 'vcWithdrawAmount', 
					title : 'vc理财资产',
					sortable: true
				},
				{
					field : 'vcFundAsset',
					title : 'vc基金资产',
					sortable: true
				},
				{
					field : 'ethAmount',
					title : 'eth余额',
					sortable: true
				},
				{
					field : 'usdtAmount',
					title : 'usdt余额',
					sortable: true
				},
				{
					field : 'walletAddress',
					title : '钱包地址',
					sortable: true
				},
				{
					field : 'walletPrivateKey',
					title : '钱包密钥',
					sortable: true
				},
				{
					field : 'referrerCode', 
					title : '邀请码',
					sortable: true
				},
                    {
                        field : 'extraData[referrerMobile]',
                        title : '推荐人',
                        sortable: false,
                        formatter: function (value, row, index) {
                            return row.extraData['referrerMobile'];
                        }
                    },
				{
					field : 'referrerId', 
					title : '推荐人id',
					sortable: true
				},
                    {
                        field : 'extraData[leaderMobile]',
                        title : '领导',
                        sortable: false,
                        formatter: function (value, row, index) {
                            return row.extraData['leaderMobile'];
                        }
                    },
				{
					field : 'leaderId', 
					title : '领导人id',
					sortable: true
				},
				{
					field : 'level', 
					title : '等级',
					sortable: true,
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(userLevel, value);
                    }
				},
				{
					field : 'version', 
					title : '版本号',
					sortable: true
				},
				{
					field : 'delFlag', 
					title : '删除标志（0代表存在 1代表删除）',
					sortable: true
				},
				{
					field : 'createBy', 
					title : '创建者',
					sortable: true
				},
				{
					field : 'createTime', 
					title : '创建时间',
					sortable: true
				},
				{
					field : 'updateBy', 
					title : '更新者',
					sortable: true
				},
				{
					field : 'updateTime', 
					title : '更新时间',
					sortable: true
				},
				{
					field : 'remark', 
					title : '备注信息',
					sortable: true
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
                        actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="showReferrer(\'' + row.userId + '\')"><i class="fa fa-list"></i>邀请</a> ');
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });

        function showReferrer(userId) {
            var url = prefix + '/referrer?userId=' + userId;
            $.modal.openTab("我的邀请", url);
        }
    </script>
</body>
</html>